#pragma once

#define NULL ((void *)0)
#define BLOCK_SIZE 512
#define true ((bool)1)
#define false ((bool)0)

typedef char bool;
typedef char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int64_t;

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;

typedef uint64_t size_t;

typedef struct __part_dev part_dev_t;
typedef struct __part part_t;

struct __part_dev
{
    uint32_t init;
    uint32_t id;
    void *blkdev;
    void *init_dev;
    int (*read)(part_dev_t *dev, uint64_t src, uint8_t *dst, int size, unsigned int part_id);
    void *write;
};
struct __part
{
    uint32_t start_sect;
    uint32_t nr_sects;
    uint32_t part_attr;
    uint32_t part_id;
    const char *name;
    void *info;
};

#define BOOTIMG_OFFSET 18 // in blocks
